using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using TidhiGanitam.DataModel;

namespace TidhiGanitamControls
{
    public partial class LineControl : UserControl
    {
        private Enums.DrawDirection m_Direction = Enums.DrawDirection.Horizontal;
        public Enums.DrawDirection DrawingDirection
        {
            get
            { return m_Direction; }
            set
            { m_Direction = value; }
        }
        public LineControl()
        {
            InitializeComponent();
        }
        protected override void InitLayout()
        {
            base.InitLayout();
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            switch (m_Direction)
            {
                case Enums.DrawDirection.Horizontal:
                    this.Height = 1;
                    e.Graphics.DrawLine(new Pen(Color.Black), 0, 0, Width, 0);
                    break;
                case Enums.DrawDirection.Vertical:
                    this.Width = 1;
                    e.Graphics.DrawLine(new Pen(Color.Black), 0, 0, 0, Height);
                    break;
            }
            base.OnPaint(e);
        }
    }
}
